home *** CD-ROM | disk | FTP | other *** search
Wrap
Text File | 1996-05-01 | 11.3 KB | 415 lines | [ TEXT/MPS ]
; ; File: SoundInput.a ; ; Contains: Sound Input Interfaces. ; ; Version: Technology: System 7.5 ; Release: Universal Interfaces 3.0d3 on Copland DR1 ; ; Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved. ; ; Bugs?: If you find a problem with this file, send the file and version ; information (from above) and the problem description to: ; ; Internet: apple.bugs@applelink.apple.com ; AppleLink: APPLE.BUGS ; ; IF &TYPE('__SOUNDINPUT__') = 'UNDEFINED' THEN __SOUNDINPUT__ SET 1 IF &TYPE('__TYPES__') = 'UNDEFINED' THEN include 'Types.a' ENDIF IF &TYPE('__APPLEEVENTS__') = 'UNDEFINED' THEN include 'AppleEvents.a' ENDIF IF &TYPE('__WINDOWS__') = 'UNDEFINED' THEN include 'Windows.a' ENDIF IF &TYPE('__DIALOGS__') = 'UNDEFINED' THEN include 'Dialogs.a' ENDIF IF &TYPE('__FILES__') = 'UNDEFINED' THEN include 'Files.a' ENDIF IF &TYPE('__SOUND__') = 'UNDEFINED' THEN include 'Sound.a' ENDIF IF FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED THEN ; ; * * * N O T E * * * ; ; This file has been updated to include Sound Input Manager 1.1 interfaces. ; ; Some of the Sound Input Manager 1.1 interfaces were not put into the InterfaceLib ; that originally shipped with the PowerMacs. These missing functions and the ; new 1.1 interfaces have been released in the SoundLib library for PowerPC ; developers to link with. The runtime library for these functions are ; installed by Sound Manager 3.2. The following functions are found in SoundLib. ; ; ParseAIFFHeader(), ParseSndHeader() ; ; siDeviceIsConnected EQU 1 ;input device is connected and ready for input siDeviceNotConnected EQU 0 ;input device is not connected siDontKnowIfConnected EQU -1 ;can't tell if input device is connected siReadPermission EQU 0 ;permission passed to SPBOpenDevice siWritePermission EQU 1 ;permission passed to SPBOpenDevice ;Info Selectors for Sound Input Drivers siActiveChannels EQU 'chac' ;active channels siActiveLevels EQU 'lmac' ;active meter levels siAGCOnOff EQU 'agc ' ;automatic gain control state siAsync EQU 'asyn' ;asynchronous capability siChannelAvailable EQU 'chav' ;number of channels available siCompressionAvailable EQU 'cmav' ;compression types available siCompressionFactor EQU 'cmfa' ;current compression factor siCompressionHeader EQU 'cmhd' ;return compression header siCompressionNames EQU 'cnam' ;compression type names available siCompressionType EQU 'comp' ;current compression type siContinuous EQU 'cont' ;continous recording siDeviceBufferInfo EQU 'dbin' ;size of interrupt buffer siDeviceConnected EQU 'dcon' ;input device connection status siDeviceIcon EQU 'icon' ;input device icon siDeviceName EQU 'name' ;input device name siHardwareBusy EQU 'hwbs' ;sound hardware is in use siInputGain EQU 'gain' ;input gain siInputSource EQU 'sour' ;input source selector siInputSourceNames EQU 'snam' ;input source names siLevelMeterOnOff EQU 'lmet' ;level meter state siModemGain EQU 'mgai' ;modem input gain siNumberChannels EQU 'chan' ;current number of channels siOptionsDialog EQU 'optd' ;display options dialog siPlayThruOnOff EQU 'plth' ;playthrough state siRecordingQuality EQU 'qual' ;recording quality siSampleRate EQU 'srat' ;current sample rate siSampleRateAvailable EQU 'srav' ;sample rates available siSampleSize EQU 'ssiz' ;current sample size siSampleSizeAvailable EQU 'ssav' ;sample sizes available siSetupCDAudio EQU 'sucd' ;setup sound hardware for CD audio siSetupModemAudio EQU 'sumd' ;setup sound hardware for modem audio siStereoInputGain EQU 'sgai' ;stereo input gain siTwosComplementOnOff EQU 'twos' ;two's complement state siVoxRecordInfo EQU 'voxr' ;VOX record parameters siVoxStopInfo EQU 'voxs' ;VOX stop parameters siCloseDriver EQU 'clos' ;reserved for internal use only siInitializeDriver EQU 'init' ;reserved for internal use only siPauseRecording EQU 'paus' ;reserved for internal use only siUserInterruptProc EQU 'user' ;reserved for internal use only ;Qualities siCDQuality EQU 'cd ' ;44.1kHz, stereo, 16 bit siBestQuality EQU 'best' ;22kHz, mono, 8 bit siBetterQuality EQU 'betr' ;22kHz, mono, MACE 3:1 siGoodQuality EQU 'good' ;22kHz, mono, MACE 6:1 ; typedef SPB * SPBPtr ; user procedures called by sound input routines ; Sound Input Parameter Block SPB RECORD 0 inRefNum ds.l 1 ; offset: $0 (0) ; reference number of sound input device count ds.l 1 ; offset: $4 (4) ; number of bytes to record milliseconds ds.l 1 ; offset: $8 (8) ; number of milliseconds to record bufferLength ds.l 1 ; offset: $C (12) ; length of buffer in bytes bufferPtr ds.l 1 ; offset: $10 (16) ; buffer to store sound data in completionRoutine ds.l 1 ; offset: $14 (20) ; completion routine interruptRoutine ds.l 1 ; offset: $18 (24) ; interrupt routine userLong ds.l 1 ; offset: $1C (28) ; user-defined field error ds.w 1 ; offset: $20 (32) ; error unused1 ds.l 1 ; offset: $22 (34) ; reserved - must be zero sizeof EQU * ; size: $26 (38) ENDR ; ; pascal NumVersion SPBVersion(void ) ; IF ¬ GENERATINGCFM THEN Macro _SPBVersion move.l #$00000014,D0 dc.w $A800 EndM ELSE IMPORT_CFM_FUNCTION SPBVersion ENDIF ; ; pascal OSErr SndRecord(ModalFilterUPP filterProc, Point corner, OSType quality, SndListHandle *sndHandle) ; IF ¬ GENERATINGCFM THEN Macro _SndRecord move.l #$08040014,D0 dc.w $A800 EndM ELSE IMPORT_CFM_FUNCTION SndRecord ENDIF ; ; pascal OSErr SndRecordToFile(ModalFilterUPP filterProc, Point corner, OSType quality, short fRefNum) ; IF ¬ GENERATINGCFM THEN Macro _SndRecordToFile move.l #$07080014,D0 dc.w $A800 EndM ELSE IMPORT_CFM_FUNCTION SndRecordToFile ENDIF ; ; pascal OSErr SPBSignInDevice(short deviceRefNum, ConstStr255Param deviceName) ; IF ¬ GENERATINGCFM THEN Macro _SPBSignInDevice move.l #$030C0014,D0 dc.w $A800 EndM ELSE IMPORT_CFM_FUNCTION SPBSignInDevice ENDIF ; ; pascal OSErr SPBSignOutDevice(short deviceRefNum) ; IF ¬ GENERATINGCFM THEN Macro _SPBSignOutDevice move.l #$01100014,D0 dc.w $A800 EndM ELSE IMPORT_CFM_FUNCTION SPBSignOutDevice ENDIF ; ; pascal OSErr SPBGetIndexedDevice(short count, Str255 deviceName, Handle *deviceIconHandle) ; IF ¬ GENERATINGCFM THEN Macro _SPBGetIndexedDevice move.l #$05140014,D0 dc.w $A800 EndM ELSE IMPORT_CFM_FUNCTION SPBGetIndexedDevice ENDIF ; ; pascal OSErr SPBOpenDevice(ConstStr255Param deviceName, short permission, long *inRefNum) ; IF ¬ GENERATINGCFM THEN Macro _SPBOpenDevice move.l #$05180014,D0 dc.w $A800 EndM ELSE IMPORT_CFM_FUNCTION SPBOpenDevice ENDIF ; ; pascal OSErr SPBCloseDevice(long inRefNum) ; IF ¬ GENERATINGCFM THEN Macro _SPBCloseDevice move.l #$021C0014,D0 dc.w $A800 EndM ELSE IMPORT_CFM_FUNCTION SPBCloseDevice ENDIF ; ; pascal OSErr SPBRecord(SPBPtr inParamPtr, Boolean asynchFlag) ; IF ¬ GENERATINGCFM THEN Macro _SPBRecord move.l #$03200014,D0 dc.w $A800 EndM ELSE IMPORT_CFM_FUNCTION SPBRecord ENDIF ; ; pascal OSErr SPBRecordToFile(short fRefNum, SPBPtr inParamPtr, Boolean asynchFlag) ; IF ¬ GENERATINGCFM THEN Macro _SPBRecordToFile move.l #$04240014,D0 dc.w $A800 EndM ELSE IMPORT_CFM_FUNCTION SPBRecordToFile ENDIF ; ; pascal OSErr SPBPauseRecording(long inRefNum) ; IF ¬ GENERATINGCFM THEN Macro _SPBPauseRecording move.l #$02280014,D0 dc.w $A800 EndM ELSE IMPORT_CFM_FUNCTION SPBPauseRecording ENDIF ; ; pascal OSErr SPBResumeRecording(long inRefNum) ; IF ¬ GENERATINGCFM THEN Macro _SPBResumeRecording move.l #$022C0014,D0 dc.w $A800 EndM ELSE IMPORT_CFM_FUNCTION SPBResumeRecording ENDIF ; ; pascal OSErr SPBStopRecording(long inRefNum) ; IF ¬ GENERATINGCFM THEN Macro _SPBStopRecording move.l #$02300014,D0 dc.w $A800 EndM ELSE IMPORT_CFM_FUNCTION SPBStopRecording ENDIF ; ; pascal OSErr SPBGetRecordingStatus(long inRefNum, short *recordingStatus, short *meterLevel, unsigned long *totalSamplesToRecord, unsigned long *numberOfSamplesRecorded, unsigned long *totalMsecsToRecord, unsigned long *numberOfMsecsRecorded) ; IF ¬ GENERATINGCFM THEN Macro _SPBGetRecordingStatus move.l #$0E340014,D0 dc.w $A800 EndM ELSE IMPORT_CFM_FUNCTION SPBGetRecordingStatus ENDIF ; ; pascal OSErr SPBGetDeviceInfo(long inRefNum, OSType infoType, void *infoData) ; IF ¬ GENERATINGCFM THEN Macro _SPBGetDeviceInfo move.l #$06380014,D0 dc.w $A800 EndM ELSE IMPORT_CFM_FUNCTION SPBGetDeviceInfo ENDIF ; ; pascal OSErr SPBSetDeviceInfo(long inRefNum, OSType infoType, void *infoData) ; IF ¬ GENERATINGCFM THEN Macro _SPBSetDeviceInfo move.l #$063C0014,D0 dc.w $A800 EndM ELSE IMPORT_CFM_FUNCTION SPBSetDeviceInfo ENDIF ; ; pascal OSErr SPBMillisecondsToBytes(long inRefNum, long *milliseconds) ; IF ¬ GENERATINGCFM THEN Macro _SPBMillisecondsToBytes move.l #$04400014,D0 dc.w $A800 EndM ELSE IMPORT_CFM_FUNCTION SPBMillisecondsToBytes ENDIF ; ; pascal OSErr SPBBytesToMilliseconds(long inRefNum, long *byteCount) ; IF ¬ GENERATINGCFM THEN Macro _SPBBytesToMilliseconds move.l #$04440014,D0 dc.w $A800 EndM ELSE IMPORT_CFM_FUNCTION SPBBytesToMilliseconds ENDIF ; ; pascal OSErr SetupSndHeader(SndListHandle sndHandle, short numChannels, UnsignedFixed sampleRate, short sampleSize, OSType compressionType, short baseNote, unsigned long numBytes, short *headerLen) ; IF ¬ GENERATINGCFM THEN Macro _SetupSndHeader move.l #$0D480014,D0 dc.w $A800 EndM ELSE IMPORT_CFM_FUNCTION SetupSndHeader ENDIF ; ; pascal OSErr SetupAIFFHeader(short fRefNum, short numChannels, UnsignedFixed sampleRate, short sampleSize, OSType compressionType, unsigned long numBytes, unsigned long numFrames) ; IF ¬ GENERATINGCFM THEN Macro _SetupAIFFHeader move.l #$0B4C0014,D0 dc.w $A800 EndM ELSE IMPORT_CFM_FUNCTION SetupAIFFHeader ENDIF ; Sound Input Manager 1.1 and later calls ; ; pascal OSErr ParseAIFFHeader(short fRefNum, SoundComponentData *sndInfo, unsigned long *numFrames, unsigned long *dataOffset) ; IF ¬ GENERATINGCFM THEN Macro _ParseAIFFHeader move.l #$07580014,D0 dc.w $A800 EndM ELSE IMPORT_CFM_FUNCTION ParseAIFFHeader ENDIF ; ; pascal OSErr ParseSndHeader(SndListHandle sndHandle, SoundComponentData *sndInfo, unsigned long *numFrames, unsigned long *dataOffset) ; IF ¬ GENERATINGCFM THEN Macro _ParseSndHeader move.l #$085C0014,D0 dc.w $A800 EndM ELSE IMPORT_CFM_FUNCTION ParseSndHeader ENDIF ENDIF ENDIF ; __SOUNDINPUT__